![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Neo-Async is thought to be used as a drop-in replacement for Async, it almost fully covers its functionality and runs faster
The neo-async package is a utility module which provides straight-forward, powerful functions for working with asynchronous JavaScript. It is similar to the async package but with some performance improvements.
Control Flow
Execute a series of functions in sequential order. Each function is passed a callback it must call on completion.
async.series([
function(callback) {
// do some stuff ...
callback(null, 'one');
},
function(callback) {
// do some more stuff ...
callback(null, 'two');
}
],
function(err, results) {
// results is now equal to ['one', 'two']
});
Collections
Apply a function to each item in a collection and collect the results.
async.map(['file1','file2','file3'], fs.stat, function(err, results) {
// results is now an array of stats for each file
});
Utilities
Call a function a certain number of times and collect the results.
async.times(5, function(n, next) {
createUser(n, function(err, user) {
next(err, user);
});
}, function(err, users) {
// we should now have 5 users
});
The original async package offers a wide array of functions for working with asynchronous code. Neo-async claims to offer similar functionality with improved performance.
Bluebird is a full-featured promise library with a focus on innovative features and performance. It can be used as an alternative to neo-async for handling asynchronous operations using promises instead of callbacks.
Q is a tool for making and composing asynchronous promises in JavaScript. It's an older promise library that can serve similar purposes to neo-async but with a different style of handling async operations.
Neo-Async is thought to be used as a drop-in replacement for Async, it almost fully covers its functionality and runs faster.
Async allows double callbacks in waterfall
, but Neo-Async does not allow. (test)
PR is welcome ! Especially improvement for English documents :)
<script src="async.min.js"></script>
require(['async'], function(async) {});
$ npm install neo-async
var async = require('neo-async');
// safe mode
var async = require('neo-async').safe; // avoid stack overflow if iterator is called on sync.
$ npm install neo-async
$ ln -s ./node_modules/neo-async ./node_modules/async
var async = require('async');
bower install neo-async
* not in Async
each
eachSeries
eachLimit
forEach
-> each
forEachSeries
-> eachSeries
forEachLimit
-> eachLimit
eachOf
-> each
eachOfSeries
-> eachSeries
eachOfLimit
-> eachLimit
forEachOf
-> each
forEachOfSeries
-> eachSeries
eachOfLimit
-> forEachLimit
map
mapSeries
mapLimit
mapValues
*mapValuesSeries
*mapValuesLimit
*filter
filterSeries
filterLimit
select
-> filter
selectSeries
-> filterSeries
selectLimit
-> filterLimit
reject
rejectSeries
rejectLimit
detect
detectSeries
detectLimit
pick
*pickSeries
*pickLimit
*omit
*omitSeries
*omitLimit
*reduce
inject
-> reduce
foldl
-> reduce
reduceRight
foldr
-> reduceRight
transform
*transformSeries
*transformLimit
*sortBy
sortBySeries
sortByLimit
*some
someSeries
someLimit
any
-> some
every
everySeries
*everyLimit
all
-> every
concat
concatSeries
concatLimit
*parallel
series
parallelLimit
waterfall
angelFall
*angelfall
-> angelFall
*whilst
doWhilst
until
forever
compose
seq
applyEach
applyEachSeries
queue
priorityQueue
cargo
auto
retry
iterator
timeout
times
timesSeries
timesLimit
apply
nextTick
setImmediate
safeNextTick
*asyncify
wrapSync
-> asyncify
constant
ensureAsync
memoize
unmemoize
log
dir
createLogger
noConflict
eventEmitter
*EventEmitter
*safe
*var async = require('neo-async').safe;
// or
var async = require('neo-async');
async.safe.each(collection, iterator, callback);
Speed comparison of server-side measured by func-comparator.
Specifications are as follows.
execute
Execution environment are as follows.
$ node perf/func-comparator
result
The value is the ratio (Neo-Async/Async) of the average speed per n times.
function | node v0.10.40 | node v0.12.7 | iojs v2.3.4 |
---|---|---|---|
each | 2.01 | 1.95 | 2.19 |
eachSeries | 2.28 | 2.62 | 2.28 |
eachLimit | 2.33 | 3.32 | 2.81 |
eachOf | 1.93 | 1.92 | 2.12 |
eachOfSeries | 2.17 | 2.79 | 2.98 |
eachOfLimit | 2.03 | 1.54 | 2.57 |
map | 3.10 | 3.11 | 3.38 |
mapSeries | 2.36 | 1.98 | 2.32 |
mapLimit | 1.76 | 1.84 | 2.06 |
filter | 2.33 | 3.70 | 6.59 |
filterSeries | 2.11 | 2.71 | 3.68 |
reject | 2.71 | 4.38 | 7.33 |
rejectSeries | 2.31 | 3.09 | 3.86 |
detect | 2.31 | 2.69 | 2.92 |
detectSeries | 2.13 | 1.96 | 2.71 |
reduce | 2.09 | 1.94 | 2.26 |
reduceRight | 2.19 | 1.93 | 2.51 |
sortBy | 1.41 | 1.66 | 1.52 |
some | 2.23 | 2.29 | 2.50 |
every | 2.22 | 2.25 | 2.93 |
concat | 12.0 | 7.23 | 10.0 |
concatSeries | 8.37 | 5.15 | 8.05 |
function | node v0.10.40 | node v0.12.7 | iojs v2.3.4 |
---|---|---|---|
parallel | 4.13 | 5.00 | 3.37 |
series | 3.13 | 2.70 | 3.03 |
parallelLimit | 2.69 | 2.96 | 2.49 |
waterfall | 3.45 | 7.24 | 7.59 |
whilst | 1.02 | 1.09 | 1.14 |
doWhilst | 1.26 | 1.36 | 1.28 |
until | 1.02 | 1.08 | 1.13 |
doUntil | 1.25 | 1.31 | 1.34 |
during | 2.15 | 2.08 | 2.08 |
doDuring | 5.08 | 5.77 | 5.39 |
times | 4.07 | 3.16 | 3.44 |
timesSeries | 2.82 | 2.58 | 2.71 |
timesLimit | 2.23 | 2.05 | 1.93 |
FAQs
Neo-Async is a drop-in replacement for Async, it almost fully covers its functionality and runs faster
The npm package neo-async receives a total of 29,717,663 weekly downloads. As such, neo-async popularity was classified as popular.
We found that neo-async demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.